*** /tmp/,RCSt1a12155	Thu Aug 24 00:18:26 1989
--- Makefile.16	Sun Aug 20 02:00:03 1989
***************
*** 57,65 ****
  _truncdfsf2.o _extendsfdf2.o
  
  GNUSTUFF = $(GNUSUPPORT) \
! lmemset.o lmemcmp.o lmemchr.o lmemccpy.o lmalloc.o 
  
! ALL	= head.o crtso.o libc.a iio.a
  
  all: install
  
--- 57,65 ----
  _truncdfsf2.o _extendsfdf2.o
  
  GNUSTUFF = $(GNUSUPPORT) \
! lmemset.o lmemcmp.o lmemchr.o lmemccpy.o
  
! ALL	= head.o crtso.o libc.a libiio.a
  
  all: install
  
***************
*** 91,103 ****
  	$(AS) $?
  	mv sthead.o $@
  
! iio.a: ivfprintf.o
  	rm -f $@
! 	$(AR) sr $@ ivfprintf.o
  
  ivfprintf.o : vfprintf.c
  	$(CC) $(CFLAGS) -D__NO_FLOATS__ -c vfprintf.c -o $@
  
  stbrksz.s : stbrksz.cpp
  stcatch.s : stcatch.cpp
  stcrtso.s : stcrtso.cpp
--- 91,106 ----
  	$(AS) $?
  	mv sthead.o $@
  
! libiio.a: ivfprintf.o iscanf.o
  	rm -f $@
! 	$(AR) sr $@ ivfprintf.o iscanf.o
  
  ivfprintf.o : vfprintf.c
  	$(CC) $(CFLAGS) -D__NO_FLOATS__ -c vfprintf.c -o $@
  
+ iscanf.o : scanf.c
+ 	$(CC) $(CFLAGS) -D__NO_FLOATS__ -c scanf.c -o $@
+ 
  stbrksz.s : stbrksz.cpp
  stcatch.s : stcatch.cpp
  stcrtso.s : stcrtso.cpp
***************
*** 105,110 ****
--- 108,114 ----
  stsetjmp.s : stsetjmp.cpp
  stsndrec.s : stsndrec.cpp
  bcopy.o : bcopy.s
+ alloca.o : alloca.s
  
  # 
  # Note: the following *must* be compiled with 32 bit ints
*** /tmp/,RCSt1a12155	Thu Aug 24 00:18:27 1989
--- Makefile.32	Sun Aug 20 02:00:26 1989
***************
*** 60,66 ****
  
  GNUSTUFF = $(GNUSUPPORT)
  
! ALL	= head32.o crtso32.o libc32.a iio32.a
  
  all: install
  
--- 60,66 ----
  
  GNUSTUFF = $(GNUSUPPORT)
  
! ALL	= head32.o crtso32.o libc32.a libiio32.a
  
  all: install
  
***************
*** 91,103 ****
  	$(AS) $?
  	mv sthead.o $@
  
! iio32.a: ivfprintf.o
  	rm -f $@
! 	$(AR) sr $@ ivfprintf.o
  
  ivfprintf.o : vfprintf.c
  	$(CC) $(CFLAGS) -D__NO_FLOATS__ -c vfprintf.c -o $@
  
  stbrksz.s : stbrksz.cpp
  stcatch.s : stcatch.cpp
  stcrtso.s : stcrtso.cpp
--- 91,106 ----
  	$(AS) $?
  	mv sthead.o $@
  
! libiio32.a: ivfprintf.o iscanf.o
  	rm -f $@
! 	$(AR) sr $@ ivfprintf.o iscanf.o
  
  ivfprintf.o : vfprintf.c
  	$(CC) $(CFLAGS) -D__NO_FLOATS__ -c vfprintf.c -o $@
  
+ iscanf.o : scanf.c
+ 	$(CC) $(CFLAGS) -D__NO_FLOATS__ -c scanf.c -o $@
+ 
  stbrksz.s : stbrksz.cpp
  stcatch.s : stcatch.cpp
  stcrtso.s : stcrtso.cpp
***************
*** 105,110 ****
--- 108,114 ----
  stsetjmp.s : stsetjmp.cpp
  stsndrec.s : stsndrec.cpp
  bcopy.o : bcopy.s
+ alloca.o : alloca.s
  
  _umulsi3.o _mulsi3.o _udivsi3.o _divsi3.o _umodsi3.o _modsi3.o : fixnumMade
  fixnumMade : fixnum.s
*** /tmp/,RCSt1a12155	Thu Aug 24 00:18:28 1989
--- PatchLevel.h	Thu Aug 24 00:17:40 1989
***************
*** 1,5 ****
  /*
!  *	PathLevel: 12
   *
   *	the Patch Level above is to identify the version
   *	of the all the files in this directory. given the above
--- 1,5 ----
  /*
!  *	PathLevel: 13
   *
   *	the Patch Level above is to identify the version
   *	of the all the files in this directory. given the above
*** /tmp/,RCSt1a12155	Thu Aug 24 00:20:04 1989
--- malloc.c	Sat Aug 19 19:31:08 1989
***************
*** 1,5 ****
--- 1,17 ----
  #include "lib.h"
  
+ #ifdef __MSHORT__
+ # define _LMALLOC  lmalloc
+ # define _LREALLOC lrealloc
+ # define _LCALLOC  lcalloc
+ # define _SIZE_T  unsigned long
+ #else
+ # define _LMALLOC  malloc
+ # define _LREALLOC realloc
+ # define _LCALLOC  calloc
+ # define _SIZE_T  unsigned 	/* fool protos */
+ #endif
+ 
  /* replace undef by define */
  #undef	 DEBUG		/* check assertions */
  #undef	 SLOWDEBUG	/* some extra test loops (requires DEBUG) */
***************
*** 17,24 ****
  #define	ptrint		long
  #endif
  
! #define BRKSIZE		1024
! #define	PTRSIZE		sizeof(char *)
  
  #ifdef __GNUC__
  #define Align(x,a)	(( ((ptrint)(x)) + ((ptrint)a - 1L)) & ~((ptrint)a - 1L))
--- 29,36 ----
  #define	ptrint		long
  #endif
  
! #define BRKSIZE		((_SIZE_T)1024)
! #define	PTRSIZE		(sizeof(char *))
  
  #ifdef __GNUC__
  #define Align(x,a)	(( ((ptrint)(x)) + ((ptrint)a - 1L)) & ~((ptrint)a - 1L))
***************
*** 50,56 ****
  static char *_bottom, *_top, *_empty;
  
  static int grow(len)
! unsigned len;
  {
    register char *p;
  
--- 62,68 ----
  static char *_bottom, *_top, *_empty;
  
  static int grow(len)
! unsigned long len;
  {
    register char *p;
  
***************
*** 65,75 ****
    return(1);
  }
  
! VOIDSTAR malloc(size)
! unsigned size;
  {
    register char *prev, *p, *next, *new;
!   register unsigned len, ntries;
  
    if (size == 0)
  	size = PTRSIZE;		/* avoid slots less that 2*PTRSIZE */
--- 77,88 ----
    return(1);
  }
  
! VOIDSTAR _LMALLOC (size)
! _SIZE_T size;
  {
    register char *prev, *p, *next, *new;
!   register unsigned long len;
!   register short ntries;
  
    if (size == 0)
  	size = PTRSIZE;		/* avoid slots less that 2*PTRSIZE */
***************
*** 76,82 ****
    for (ntries = 0; ntries < 2; ntries++) {
  	len = Align(size, PTRSIZE) + PTRSIZE;
  	if (_bottom == 0) {
! 		p = sbrk(2 * PTRSIZE);
  		p = (char *) Align((ptrint)p, PTRSIZE);
  		p += PTRSIZE;
  		_top = _bottom = p;
--- 89,95 ----
    for (ntries = 0; ntries < 2; ntries++) {
  	len = Align(size, PTRSIZE) + PTRSIZE;
  	if (_bottom == 0) {
! 		p = sbrk((int)(2 * (int)PTRSIZE));
  		p = (char *) Align((ptrint)p, PTRSIZE);
  		p += PTRSIZE;
  		_top = _bottom = p;
***************
*** 114,129 ****
    return(0);
  }
  
! VOIDSTAR realloc(old, size)
  VOIDSTAR old;
! unsigned size;
  {
    register char *prev, *p, *next, *new;
!   register unsigned len, n;
  
    len = Align(size, PTRSIZE) + PTRSIZE;
    next = NextSlot(old);
!   n = (int)(next - (char *)old);			/* old length */
    /*
     * extend old if there is any free space just behind it
     */
--- 127,144 ----
    return(0);
  }
  
! VOIDSTAR _LREALLOC(old, size)
  VOIDSTAR old;
! _SIZE_T size;
  {
    register char *prev, *p, *next, *new;
!   register unsigned long len, n;
  
+   if(old == (VOIDSTAR)0) return _LMALLOC(size);
+ 
    len = Align(size, PTRSIZE) + PTRSIZE;
    next = NextSlot(old);
!   n = (unsigned long)(next - (char *)old);			/* old length */
    /*
     * extend old if there is any free space just behind it
     */
***************
*** 153,159 ****
  	}
  	return(old);
    }
!   if ((new = malloc(size)) == 0)		/* it didn't fit */
  	return(0);
    bcopy(old, new, (long)n);				/* n < size */
    free(old);
--- 168,174 ----
  	}
  	return(old);
    }
!   if ((new = _LMALLOC(size)) == 0)		/* it didn't fit */
  	return(0);
    bcopy(old, new, (long)n);				/* n < size */
    free(old);
***************
*** 160,184 ****
    return(new);
  }
  
! /* static bcopy(old, new, n)
! register char *old, *new;
! register n;
! {
!   while (n--)
! 	*new++ = *old++;
! }
! */
! VOIDSTAR calloc(n, size)
! unsigned n, size;
  {
!   register char *p, *cp;
  
    n *= size;
!   cp = malloc(n);
    if (cp == (char *)0)
  	return ((char *)0);
!   for (p = cp; n-- != 0; )
! 	*p++ = '\0';
    return(cp);
  }
  
--- 175,190 ----
    return(new);
  }
  
! VOIDSTAR _LCALLOC(n, size)
! _SIZE_T n, size;
  {
!   register char *cp;
  
    n *= size;
!   cp = _LMALLOC(n);
    if (cp == (char *)0)
  	return ((char *)0);
!   bzero(cp, (long)n);
    return(cp);
  }
  
***************
*** 218,221 ****
--- 224,242 ----
  	write(2, "assert failed in lib/malloc.c\n", 30);
  	abort();
  }
+ #endif
+ 
+ #ifdef __MSHORT__
+ VOIDSTAR malloc(n)
+ unsigned int n;
+ { return lmalloc((unsigned long)n); }
+ 
+ VOIDSTAR realloc(old, n)
+ VOIDSTAR old;
+ unsigned int n;
+ { return lrealloc(old, (unsigned long)n); }
+ 
+ VOIDSTAR calloc(n, m)
+ unsigned int n, m;
+ { return lcalloc((unsigned long)n, (unsigned long)m); }
  #endif
*** /tmp/,RCSt1a12155	Thu Aug 24 00:20:30 1989
--- qsort.c	Sun Aug 20 02:04:08 1989
***************
*** 176,187 ****
  	unsigned long size;
  	int (*cmp)();
  {
! 
  #ifdef SHORT_ALIGN_DESIRABLE
! 	if((size == 2) && SHORT_ALIGNED(base))
  		_wqsort((ushort *)base, 0, num-1, cmp);
! 	else if((size == 4) && LONG_ALIGNED(base))
  		_lqsort((ulong *)base, 0, num-1, cmp);
  #else
  	if((size == 4) && LONG_ALIGNED(base))
  	    _lqsort((ulong *)base, 0, num-1, cmp);
--- 176,205 ----
  	unsigned long size;
  	int (*cmp)();
  {
! 	if(num < 2)
! 	    return; /* nothing to do */
! 	else if(num == 2)  /* at some point replace if n < THRESH do insert sort */
! 	{	/* degenerate case */
! 	    if(((*cmp)( base, ((uchar *)base)+size )) > 0)
! 	    {
! 		if((_qbuf = alloca(size)) == (void *)0) return;
! 		bcopy(base, _qbuf, size);
! 		bcopy(((uchar *)base)+size, base, size);
! 		bcopy(_qbuf, ((uchar *)base)+size,  size);
! 	    }
! 	    return;
!         }
  #ifdef SHORT_ALIGN_DESIRABLE
! 	/* assumption: if short align desired, then its ok to
! 	   align a long at a short boundary too.
! 	 */
! 	if(SHORT_ALIGNED(base))
! 	{
! 	    if(size == 2)
  		_wqsort((ushort *)base, 0, num-1, cmp);
! 	    else if(size == 4)
  		_lqsort((ulong *)base, 0, num-1, cmp);
+ 	}
  #else
  	if((size == 4) && LONG_ALIGNED(base))
  	    _lqsort((ulong *)base, 0, num-1, cmp);
***************
*** 188,194 ****
  #endif
  	else
  	{
! 		_qbuf = (uchar *)alloca(size);
  		_nqsort((uchar *)base, 0, num-1, size, cmp);
  	}
  }
--- 206,212 ----
  #endif
  	else
  	{
! 		if((_qbuf = alloca(size)) == (void *)0) return;
  		_nqsort((uchar *)base, 0, num-1, size, cmp);
  	}
  }
*** /tmp/,RCSt1a12155	Thu Aug 24 00:20:39 1989
--- scanf.c	Sat Aug 19 04:19:03 1989
***************
*** 60,67 ****
--- 60,69 ----
      char           *chr_p;
      unsigned int   *uint_p;
      unsigned long  *ulong_p;
+ #ifndef __NO_FLOATS__
      float	       *float_p;
      double	       *double_p;
+ #endif
  };
  
  static int      ic;		/* the current character */
***************
*** 156,161 ****
--- 158,164 ----
      return ch;
  }
  
+ #ifndef __NO_FLOATS__
  #ifdef __GNUC__
  /* eval f * 10**p */
  static double _fraise(f, p)
***************
*** 171,177 ****
      return f;
  }
  #endif
! 
  
  /*
   * the routine that does the job 
--- 174,180 ----
      return f;
  }
  #endif
! #endif
  
  /*
   * the routine that does the job 
***************
*** 194,202 ****
--- 197,207 ----
      int             done_some;	/* true if we have seen some data */
      int		reverse;	/* reverse the checking in [...] */
      char	       *endbracket;     /* position of the ] in format string */
+ #ifndef __NO_FLOATS__
  #ifdef __GNUC__
      double		fval;		/* a double value  */
  #endif
+ #endif
      
      
      rnc_arg = funcarg;
***************
*** 331,336 ****
--- 336,342 ----
  		goto all_done;
  	    break;
  	    
+ #ifndef __NO_FLOATS__
  #ifdef __GNUC__
  	  case 'e':
  	  case 'f':
***************
*** 396,401 ****
--- 402,408 ----
  		goto all_done;
  	    break;
  #endif /* __GNUC__ */
+ #endif /* __NO_FLOATS__ */
  
  	  case '[':
  	    if (!widflag)
*** /tmp/,RCSt1a12155	Thu Aug 24 00:20:54 1989
--- std.h	Sat Aug 19 19:32:10 1989
***************
*** 325,331 ****
  void *		lmemchr(CONST void *, int, long);
  void *		lmemccpy(void *, CONST void *, int, long);
  void *		lmalloc(unsigned long);
! void *		lremalloc(void *, unsigned long);
  void *		lcalloc(unsigned long, unsigned long);
  
  #endif	/* __MSHORT__ */
--- 325,331 ----
  void *		lmemchr(CONST void *, int, long);
  void *		lmemccpy(void *, CONST void *, int, long);
  void *		lmalloc(unsigned long);
! void *		lrealloc(void *, unsigned long);
  void *		lcalloc(unsigned long, unsigned long);
  
  #endif	/* __MSHORT__ */
***************
*** 356,362 ****
  #define lmemchr		memchr
  #define lmemccpy	memccpy
  #define lmalloc		malloc
! #define lremalloc	realloc
  #define lcalloc		calloc
  #endif
  
--- 356,362 ----
  #define lmemchr		memchr
  #define lmemccpy	memccpy
  #define lmalloc		malloc
! #define lrealloc	realloc
  #define lcalloc		calloc
  #endif
  
